﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SeguradoraIA.Framework
{
    public class UserControlBase : System.Web.UI.UserControl
    {
        private static readonly object EventSubmitKey = new object();

        #region [ definição do Evento ]
        public event EventHandler TransferObject
        {
            add
            {
                Events.AddHandler(EventSubmitKey, value);
            }
            remove
            {
                Events.RemoveHandler(EventSubmitKey, value);
            }
        }

        // Disparando eventos de clicks nos botões
        public virtual void OnSubmit(object source, EventArgs e)
        {
            EventHandler SubmitHandler =
                (EventHandler)Events[EventSubmitKey];
            if (SubmitHandler != null)
            {
                SubmitHandler(source, e);
            }
        }
        #endregion
    }
}
